/**
 * @file thread_btest.c
 * @brief 
 * 
 * @author dalin (dalin@open-robot.com)
 * @version 1.0
 * @date 2023-05-09
 * 
 * @copyright Copyright (c) 2023  Open Robot Tech.co, Ltd
 * 
 * @par 修改日志:
 * <table>
 * <tr><th>Date       <th>Version <th>Author  <th>Description
 * <tr><td>2023-05-09 <td>1.0     <td>dalin     <td>内容
 * </table>
 */

#include "FreeRTOS.h"
#include "cmsis_os.h"

#include "mlog.h"
#include "user_data.h"
#include "thread_idle.h"
#include "thread_config.h"

#include "dev_bluetooth.h"
#include "dev_mpu6050.h"
#include "dev_encoder.h"
#include "vofa.h"

void btest_thread(void const * argument)
{
    imuAngle_t imu_data;
    float temp;
    // printf("user wheel start\r\n");
    osDelay(INTO_THREAD_DELAY / 10);
	log_base("into btest task");

    mpu6050_open();
    encoder_open();

    for(;;)
    {
        dev_read_encoder_test();
        get_imu_angle(&imu_data);
		vofa_upload(&imu_data, sizeof(imu_data));
//		log_info("mpu6050 pit:%f", imu_data.pitch);
//        mpu6050_read_temp(&temp);
//        log_info("mpu6050 temp:%f", temp);

        osDelay(THREAD_DELAY_BTEST);

    }
}

